package com.yunsoft.pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="User")
public class User {
	@Id
	@Column(name="userId")
	private int userId;
	@Column(name="nickName")
	private String nickName;
	@Column(name="passwd")
	private String passwd;
	@Column(name="mobile")
	private String mobile;
	@Column(name="sex")
	private int sex;
	@Column(name="age")
	private int age;
	@Column(name="sourceType")
	private int sourceType;
	@Column(name="address")
	private String address;
	@Column(name="openId")
	private String openId;
	@Column(name="city")
	private String city;
	@Column(name="province")
	private String province;
	@Column(name="country")
	private String country;
	@Column(name="avatarUrl")
	private String avatarUrl;
	@Column(name="sessionKey")
	private String sessionKey;
	
	public User(){
		
	}


	public User(int userId,String nickName, String passwd, String mobile, int sex, int age, int sourceType, String address,
			String openId, String city, String province, String country, String avatarUrl,String sessionKey) {
		super();
		this.userId = userId;
		this.nickName = nickName;
		this.passwd = passwd;
		this.mobile = mobile;
		this.sex = sex;
		this.age = age;
		this.sourceType = sourceType;
		this.address = address;
		this.openId = openId;
		this.city = city;
		this.province = province;
		this.country = country;
		this.avatarUrl = avatarUrl;
		this.sessionKey = sessionKey;
	}
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	public String getNickName() {
		return nickName;
	}
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	public String getPasswd() {
		return passwd;
	}
	public void setPasswd(String passwd) {
		this.passwd = passwd;
	}
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	public int getSex() {
		return sex;
	}
	public void setSex(int sex) {
		this.sex = sex;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public int getSourceType() {
		return sourceType;
	}
	public void setSourceType(int sourceType) {
		this.sourceType = sourceType;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getOpenId() {
		return openId;
	}
	public void setOpenId(String openId) {
		this.openId = openId;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getProvince() {
		return province;
	}
	public void setProvince(String province) {
		this.province = province;
	}
	public String getCountry() {
		return country;
	}
	public void setCountry(String country) {
		this.country = country;
	}
	public String getAvatarUrl() {
		return avatarUrl;
	}
	public void setAvatarUrl(String avaterUrl) {
		this.avatarUrl = avaterUrl;
	}
	
	public String getSessionKey() {
		return sessionKey;
	}

	public void setSessionKey(String sessionKey) {
		this.sessionKey = sessionKey;
	}

    private User(Builder builder) {
        userId = builder.userId;
        nickName = builder.nickName;
        passwd = builder.passwd;
        mobile = builder.mobile;
        sex = builder.sex;
        age = builder.age;
        sourceType = builder.sourceType;
        address = builder.address;
        openId = builder.openId;
        city = builder.city;
        province = builder.province;
        country = builder.country;
        avatarUrl = builder.avatarUrl;
        sessionKey = builder.sessionKey;
    }

    public static final class Builder {
        private int userId;
        private String nickName;
        private String passwd;
        private String mobile;
        private int sex;
        private int age;
        private int sourceType;
        private String address;
        private String openId;
        private String city;
        private String province;
        private String country;
        private String avatarUrl;
        private String sessionKey;

        public Builder() {
        }

        public Builder userId(int val) {
            userId = val;
            return this;
        }

        public Builder nickName(String val) {
            nickName = val;
            return this;
        }

        public Builder passwd(String val) {
            passwd = val;
            return this;
        }

        public Builder mobile(String val) {
            mobile = val;
            return this;
        }

        public Builder sex(int val) {
            sex = val;
            return this;
        }

        public Builder age(int val) {
            age = val;
            return this;
        }
        public Builder sessionKey(String val) {
        	sessionKey = val;
        	return this;
        }

        public Builder sourceType(int val) {
            sourceType = val;
            return this;
        }

        public Builder address(String val) {
            address = val;
            return this;
        }

        public Builder openId(String val) {
            openId = val;
            return this;
        }

        public Builder city(String val) {
            city = val;
            return this;
        }

        public Builder province(String val) {
            province = val;
            return this;
        }

        public Builder country(String val) {
            country = val;
            return this;
        }

        public Builder avatarUrl(String val) {
            avatarUrl = val;
            return this;
        }

        public User build() {
            return new User(this);
        }
    }
	
}
